local graphics = require("BBE.graphics")
local config = require("BBE.config")
local input = require("BBE.input")
local utils = require("BBE.utils")

local _texture = graphics.sprite.NewTexture("icon.png")

local player = graphics.sprite.NewSprite(_texture)

local x, y = 0, 0

local speed = 8

local rot = 0

function update()

    if input.keys.W then
        y = y + speed*utils.time.get_delta_time()
    end

    if input.keys.S then
        y = y - speed*utils.time.get_delta_time()
    end

    if input.keys.D then
        x = x + speed*utils.time.get_delta_time()
    end

    if input.keys.A then
        x = x - speed*utils.time.get_delta_time()
    end

    rot = rot + utils.time.get_delta_time()

    graphics.sprite.SetPos(player, {x, y, -5})
    graphics.sprite.SetRotate(player, {rot, rot, rot})
    print(tostring(utils.time.get_fps_count()))
end